﻿// Copyright (C) 2012 Kim Jensen, TaskJunction.com
// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TaskJunctionLib.Model;

namespace TaskJunctionLib.Mapping.JSON
{
    public class ProjectStatusMapper : JSONMapper<ProjectStatus>
    {
        public override void deserializeFromJSON(System.Json.JsonValue jsonObject, ProjectStatus obj)
        {
            obj.Id = jsonObject["id"].ReadAs<Int32>();
            obj.Title = jsonObject["title"].ReadAs<string>();
        }

        public override void serializeToJSON(System.Json.JsonValue jsonObject, ProjectStatus obj)
        {
            jsonObject["id"] = obj.Id;
            jsonObject["title"] = obj.Title;
        }

        protected override string JSONName()
        {
            return "project_status";
        }
    }
}
